package pe.edu.upc.e41a.javasoft.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pe.edu.upc.e41a.javasoft.domain.Aviso;


@Service
@Transactional
public class AvisoServiceImpl implements AvisoService {

	public long countAllAvisoes() {
        return Aviso.countAvisoes();
    }

	public void deleteAviso(Aviso aviso) {
        aviso.remove();
    }

	public Aviso findAviso(Integer id) {
        return Aviso.findAviso(id);
    }

	public List<Aviso> findAllAvisoes() {
        return Aviso.findAllAvisoes();
    }

	public List<Aviso> findAvisoEntries(int firstResult, int maxResults) {
        return Aviso.findAvisoEntries(firstResult, maxResults);
    }

	public void saveAviso(Aviso aviso) {
        aviso.persist();
    }

	public Aviso updateAviso(Aviso aviso) {
        return aviso.merge();
    }
}
